<!-- HTML5 sekce pro fórum -->
      <section id="content">
        <?php if (Auth::instance()->logged_in('admin')): ?>
        <span class="button-white"><a href="<?php echo url::base(); ?>discussions/add" title="Přidat nové téma">Přidat téma</a></span>
        <span class="button-white"><a href="<?php echo url::base(); ?>discussions/my" title="Mé diskuze">Mé diskuze</a></span>
        <?php endif ?>
        <table id="discussions">
          <thead>
            <tr>
              <th class="topic">Téma</th>
              <th class="replies">Odpovědí</th>
              <th class="last-active">Poslední aktivita</th>
              <th class="last-post">Poslední příspěvek</th>
            </tr>
          </thead>
          <tbody>
        <?php foreach ($discussions as $item): ?>
            <tr class="discussion sticky">
              <td class="topic">
                <a href="<?php echo url::base(); ?>discussion/<?php echo $item->id ?>-<?php echo $item->seo_title ?>" title=""><strong><?php echo ucfirst($item->title) ?></strong></a>
                <br /><span class="text-gray">Kategorie: <a href="<?php echo url::base(); ?>discussions/category/<?php echo $item->category; ?>" title="Kategorie <?php $cat = ORM::factory('discussions_category')->find($item->category); echo $cat->name ?>"><?php echo $cat->name ?></a></span>
              </td>
              <td class="replies"><?php echo $item->discussions_reply->count_all() ?></td>
              <?php $reply = $item->discussions_reply->order_by('id','desc')->find(); ?>
              <td class="last-active" title="<?php if ($reply->id > 0) { echo Helpers_Photovoice::datum($reply->date); } else { echo Helpers_Photovoice::datum($item->date); } ?>"><?php if ($reply->id > 0) { echo Helpers_Photovoice::datum($reply->date); } else { echo Helpers_Photovoice::datum($item->date); } ?></td>
              <td class="last-post">
                <a href="<?php echo url::base(); ?>profile/<?php if ($reply->id > 0) { echo $reply->username; } else { echo $item->username; } ?>" title="Profil uživatele <?php if ($reply->id > 0) { echo $reply->username; } else { echo $item->username; } ?>"><?php if ($reply->id > 0) { echo $reply->username; } else { echo $item->username; } ?></a>
              </td>
            </tr>
        <?php endforeach ?>
          </tbody>
        </table>
      </section>